package com.culturalCenter.dataCenter.mapper.user;

import com.culturalCenter.dataCenter.entity.user.UserLocationTypeCount;
import com.culturalCenter.dataCenter.mapper.base.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserLocationTypeCountMapper extends BaseMapper<UserLocationTypeCount> {

    /**
     * 通过用户id查询
     *
     * @param userId 用户id
     *
     * @return
     */
    List<UserLocationTypeCount> queryByUserId(@Param("userId") String userId);

    /**
     * 批量统计
     *
     * @param userLocationTypeCountList
     */
    void insertBatch(List<UserLocationTypeCount> userLocationTypeCountList);

    /**
     * 清空表
     */
    @Delete("TRUNCATE cdc_user_location_type_count")
    void deleteAll();

}
